package com.changdiantech.cdfootball

import android.content.Intent
import com.changdiantech.cdfootball.plugins.UpdateVersionPlugin
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant


class MainActivity : FlutterFragmentActivity() {

    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
        super.configureFlutterEngine(flutterEngine)
//        flutterEngine.plugins.add(MobpushPlugin())
        flutterEngine.plugins.add(UpdateVersionPlugin())
        GeneratedPluginRegistrant.registerWith(flutterEngine)
    }

    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        //需要调用setIntent方法，不然后面获取到的getIntent都试上一次传的数据
        setIntent(intent)
//        dealPushResponse(intent)
    }

//    private fun dealPushResponse(intent: Intent?) {
//        var bundle: Bundle? = null
//        if (intent != null) {
//            MobPush.notificationClickAck(intent)
//            MobPushUtils.parseMainPluginPushIntent(intent)
//            bundle = intent.extras
//            PlayloadDelegate().playload(this, bundle)
//        }
//    }
}
